package cn.quevo.cube.provide.define.service.impl;

import cn.quevo.common.entity.PageResult;
import cn.quevo.cube.provide.define.dao.CubeColumnItemDao;
import cn.quevo.cube.provide.define.entity.CubeColumnItem;
import cn.quevo.cube.provide.define.entity.query.CubeColumnItemQuery;
import cn.quevo.cube.provide.define.service.CubeColumnItemService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 字段选择项 Service接口实现
 *
 * @author July july_sky@foxmail.com
 * @version 1.0
 * @date 2018/12/11 14:56:48
 * @Copyright 东方浩星（北京）传媒科技有限公司版权所有.All Rights Reserved.
 */
@Service("cubeColumnItemService")
@Transactional(transactionManager="transactionManager",rollbackFor={Exception.class})
public class CubeColumnItemServiceImpl implements CubeColumnItemService {
    @Resource(name="cubeColumnItemDao")
    private CubeColumnItemDao cubeColumnItemDao;

    @Override
    public Map<String,Object> getSinge(CubeColumnItemQuery cubeColumnItemQuery) {
        return this.cubeColumnItemDao.getSinge(cubeColumnItemQuery);
    }

    @Override
    public Integer create(CubeColumnItem cubeColumnItem) {
        cubeColumnItem.validateCreate();
        return this.cubeColumnItemDao.create(cubeColumnItem);
    }

    @Override
    public Integer update(CubeColumnItem cubeColumnItem) {
        cubeColumnItem.validateUpdate();
        return this.cubeColumnItemDao.update(cubeColumnItem);
    }

    @Override
    public PageResult<Map<String,Object>> getPage(CubeColumnItemQuery cubeColumnItemQuery) {
        return this.cubeColumnItemDao.getPage(cubeColumnItemQuery);
    }
}
